package jp.tkym.labs.store;

import jp.tkym.labs.store.api.Entity;
import jp.tkym.labs.store.api.Indexed;
import jp.tkym.labs.store.api.Key;

@Entity
public class Foo {
	private String stringValue;
	private int intValue;
	private short shortValue;
	private Integer integerValue;
	private long longValue;
	@Indexed
	public int getIntValue() {
		return intValue;
	}
	public void setIntValue(int intValue) {
		this.intValue = intValue;
	}
	public short getShortValue() {
		return shortValue;
	}
	public void setShortValue(short shortValue) {
		this.shortValue = shortValue;
	}
	public Integer getIntegerValue() {
		return integerValue;
	}
	public void setIntegerValue(Integer integerValue) {
		this.integerValue = integerValue;
	}
	public long getLongValue() {
		return longValue;
	}
	public void setLongValue(long longValue) {
		this.longValue = longValue;
	}
	@Key
	public String getStringValue() {
		return stringValue;
	}
	public void setStringValue(String stringValue) {
		this.stringValue = stringValue;
	}

	static Foo create(long id){
		Foo foo = new Foo();
		foo.setIntegerValue(new Integer((int)id));
		foo.setIntValue((int)id);
		foo.setLongValue(id);
		foo.setStringValue(Long.toString(id));
		return foo;
	}
}
